package com.fooddiary.util;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class AppContextConfig implements ServletContextListener{

	private static ServletContext servletContext;
	
	
	@Override
	public void contextDestroyed(ServletContextEvent p_servletContextEvent) {
	
	}

	@Override
	public void contextInitialized(ServletContextEvent p_servletContextEvent) {
		servletContext = p_servletContextEvent.getServletContext();
	}

	/**
	 * Returns initialized servlet context
	 * @return {@link ServletContext}
	 */
	public static ServletContext getServletContext() {
		return servletContext;
	}
	
	
}
